#!/bin/sh
TIME=`date -d "-1 day" "+%Y-%m-%d"`
#TIME=`date +%Y-%m-%d`
#cd /root/backup/log
cd /root/backup/rsync
cp auditNew.log.$TIME.tar.gz /root/backup/log 
#wget -c -t 0  http://account.trinitigame.com/auditlog/auditNew.log.$TIME
#wget -c -t 0  http://account.trinitigame.com/auditlog/auditNew.log.$TIME.tar.gz
cd /root/backup/log
tar zxvf auditNew.log.$TIME.tar.gz
#sleep 20s
#sed -i -e '/whatday/!d' hero.log.$TIME
sleep 25s
more /root/backup/log/auditNew.log.$TIME|cut -b22- >/root/backup/log/auditNew/$TIME
sleep 15s
cd /root/backup/log/auditNew/
split -l 30000 $TIME $TIME
sleep 30s
cp /root/backup/log/auditNew/$TIME'aa' /var/www/log/auditNew/log
sleep 5s
sed -i -e '/+*/!d' log
sleep 5s
sed -i -e '/.+/d' log
sleep 5s
sed -i -e '/)-)/d' log
sleep 5s
sed -i -e '/)(/d' log
#cp /root/backup/log/hero/$TIME'ab' /var/www/log/hero/logb
sleep 5s
php -q /var/www/log/hero/trunk/truncate.php
sleep 10s
php -q /var/www/log/hero/trunk/hero.php
sleep 10s
php -q /var/www/log/hero/trunk/del.php
sleep 10s
php -q /var/www/log/hero/trunk/blacklist.php
#sleep 30s
rm -rf  /root/backup/log/auditNew/$TIME*
sleep 10s
php -q /var/www/log/hero/trunk/filter.php
sleep 10s
php -q /var/www/log/hero/trunk/insert.php
sleep 10s
php -q /var/www/log/hero/trunk/report_nojailbreak.php
sleep 10s
php -q /var/www/log/hero/trunk/report.php
#sleep 30s
#php -q /var/www/log/hero/trunk/report_week_nojailbreak.php
sleep 10s
php -q /var/www/log/hero/trunk/update_empty.php
